import java.sql.SQLOutput;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Lyn
 * Date: 2025-01-22
 * Time: 10:06
 */
class Animal{
    String name;
    int year;
    int month;
    int day;

    static int age;
    static {
        age = 3;
    }
    public static void back(){
        age += 1;
        System.out.println(age);
    }
    public void bark(){
        System.out.println(name+"汪汪汪！！！");
    }
    public void numb(int a){
        System.out.println(name+a);
    }
    public Animal(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public Animal(int month,int day){
        this.month = month;
        this.day = day;
    }
    public Animal(){
        this(2024,3,23);
        /*this.year = 2024;
        this.month = 3;
        this.day = 23;*/
    }
    public void printDate(){
        System.out.println(year+"-"+month+"-"+day);
    }

    @Override
    public String toString() {
        return "Animal{" +
                "year=" + year +
                ", month=" + month +
                ", day=" + day +
                '}';
    }
}
public class text {
    public static void main(String[] args) {
        Animal dog = new Animal(2020,1,11);
        dog.name = "小狗";
        dog.bark();
        dog.numb(666);
        dog.printDate();
        System.out.println("======================");
        Animal cat = new Animal(2025,1,22);
        cat.printDate();
        Animal ant = new Animal(3,31);
        ant.printDate();
        Animal bird = new Animal();
        bird.printDate();
        Animal.back();
        System.out.println("=====================================");
        Animal animal = new Animal(2020,2,2);
        System.out.println(animal);
    }
}
